---
layout: single
elementName: link
---

<section id="link" class="element">
  <header class="element-header">
    <nav class="element-links">
      <span>
        Self-closing:
        <strong>
            No
        </strong>
      </span>
      <a class="element-links-direct" href="{{site.url}}/element/link/" data-element-name="link" data-tooltip="Single page for this element">Permalink</a>
      <a class="element-share" data-tooltip="Share on Twitter or Facebook" data-element-name="link">Share</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/HTML/Element/link" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="element-name">
      <a href="#link">
        <span>#</span>
        link
      </a>
    </h2>
    <div class="element-description">
      <p>Defines a <strong>link</strong> between the current web page and an external link or resource.</p>

    </div>
  </header>

      <div id="link-example-0" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#link-example-0-code">Copy</a>
        </p>
        <article class="example-preview">
          <div id="link-example-0-code" class="example-code">{% highlight html %}<link rel="stylesheet" type="text/css" href="{{site.url}}/css/website.css">{% endhighlight %}</div>
        </article>
      </div>

    <article id="link-href" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="href">
            href
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the URL of the link.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="link-href-siteurlcsswebsitecss" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy href=&quot;{{site.url}}/css/website.css&quot;" data-clipboard-text="href=&quot;{{site.url}}/css/website.css&quot;">
                      "{{site.url}}/css/website.css"
                  </code>
                </h4>
              <div class="value-description">
                <p>You can pass an <strong>absolute</strong> URL.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  href="{{site.url}}/css/website.css"></link></div>
            </aside>
          </article>
          <article id="link-href-csswebsitecss" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy href=&quot;/css/website.css&quot;" data-clipboard-text="href=&quot;/css/website.css&quot;">
                      "/css/website.css"
                  </code>
                </h4>
              <div class="value-description">
                <p>You can pass a URL <strong>relative</strong> to the root domain.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  href="/css/website.css"></link></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="link-rel" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="rel">
            rel
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types">link type</a>, explaining how the link relates to the current web page.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="link-rel-stylesheet" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy rel=&quot;stylesheet&quot;" data-clipboard-text="rel=&quot;stylesheet&quot;">
                      "stylesheet"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is a stylesheet.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  rel="stylesheet"></link></div>
            </aside>
          </article>
          <article id="link-rel-icon" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy rel=&quot;icon&quot;" data-clipboard-text="rel=&quot;icon&quot;">
                      "icon"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is a favicon.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  rel="icon"></link></div>
            </aside>
          </article>
          <article id="link-rel-author" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy rel=&quot;author&quot;" data-clipboard-text="rel=&quot;author&quot;">
                      "author"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is the web page&#39;s author website.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  rel="author"></link></div>
            </aside>
          </article>
          <article id="link-rel-next" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy rel=&quot;next&quot;" data-clipboard-text="rel=&quot;next&quot;">
                      "next"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is the next page.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  rel="next"></link></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="link-type" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="type">
            type
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the type of the linked resource.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="link-type-textcss" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy type=&quot;text/css&quot;" data-clipboard-text="type=&quot;text/css&quot;">
                      "text/css"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is a CSS file.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  type="text/css"></link></div>
            </aside>
          </article>
          <article id="link-type-texthtml" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy type=&quot;text/html&quot;" data-clipboard-text="type=&quot;text/html&quot;">
                      "text/html"
                  </code>
                </h4>
              <div class="value-description">
                <p>The link is an HTML document.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><link  type="text/html"></link></div>
            </aside>
          </article>
      </div>
    </article>
</section>
